<template>
<div>
  <el-table size="small" stripe border :data="teacher" fit>
    <el-table-column prop="name" label="姓名"></el-table-column>
    <el-table-column prop="id" label="老师id"> </el-table-column>
    <el-table-column prop="room" label="教研室"> </el-table-column>
  </el-table>
</div>
</template>

<script>
export default {
    mounted() {
    this.initTeacher();
  },
  data() {
    return {
      teacher: [],
      user: JSON.parse(window.sessionStorage.getItem("user")),
    };
  },
methods: {
  initTeacher() {
    this.getRequest("/class/" + this.user.clazz, {}).then((resp) => {
      if (resp) {
        this.teacher = resp;
      }
    });
  },
  }
};
</script>

<style></style>
